#pragma once

#include <iostream>

class Point
{
public:
    Point();
    Point(int x, int y);

    double pointLength() const;

    int getX() const;
    int getY() const;

    friend struct ComparePoint;

    friend bool operator<(const Point & lhs, const Point & rhs);

    friend std::ostream &operator<<(std::ostream & os, const Point & p);

private:
    int _ix;
    int _iy;

};

struct ComparePoint{
    bool operator()(const Point &lhs, const Point &rhs) const;
};

bool operator<(const Point & lhs, const Point & rhs);

std::ostream &operator<<(std::ostream & os, const Point & p);

namespace std{
template <>//模板的特化
    struct less<Point>{
        bool operator()( const Point& lhs, const Point& rhs ) const;
    };
}//end of namespace std
